using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using IGlobalist.Cms.Bll;
using IGlobalist.Cms.Model;
using IGlobalist.Cms.Common;

namespace IGlobalist.Cms.Admin
{
    public partial class ResourceFolderManagement : AdminBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ucActionBar.ObjectTypeCurrent = CmsObjectType.ResourceFolder;
                ucActionBarBottom.ObjectTypeCurrent = CmsObjectType.ResourceFolder;
            }
            try
            {
                ucResourceFolderTree.TreeNodeClick += ucResourceFolderAddEdit.DoEditResourceFolder;
                ucResourceFolderTree.TreeNodeClick += ucActionBar.DoListEditClick;
                ucResourceFolderTree.TreeNodeClick += ucActionBarBottom.DoListEditClick;
                ucResourceFolderTree.TreeNodeClick += HiddenInfo;
                ucResourceFolderTree.TreeNodeClick += ucResourceFolderAddEdit.DoShow;
                ucActionBar.SaveButtonClick += ucResourceFolderAddEdit.DoSaveResourceFolder;
                ucActionBarBottom.SaveButtonClick += ucResourceFolderAddEdit.DoSaveResourceFolder;
                ucActionBarBottom.SaveButtonClick += ucActionBarBottom.DoEditClassClick;
                ucActionBarBottom.SaveButtonClick += ucActionBar.DoEditClassClick;
                ucActionBar.SaveButtonClick += ucActionBarBottom.DoEditClassClick;
                ucActionBar.SaveButtonClick += ucActionBar.DoEditClassClick;


                ucResourceFolderAddEdit.EventSaveSuccess += ucResourceFolderTree.BindRefesh;
                ucResourceFolderAddEdit.EventSaveSuccess += ucResourceFolderAddEdit.DoNewResourceFolder;                

                ucActionBar.DeleteButtonClick += ucResourceFolderTree.DoDeleteFolder;
                ucActionBar.DeleteButtonClick += ucResourceFolderAddEdit.DoNewResourceFolder;
                ucActionBar.DeleteButtonClick += ucActionBar.DoEditClassClick;
                ucActionBar.DeleteButtonClick += ucActionBarBottom.DoEditClassClick;
                ucActionBarBottom.DeleteButtonClick += ucResourceFolderTree.DoDeleteFolder;
                ucActionBarBottom.DeleteButtonClick += ucResourceFolderAddEdit.DoNewResourceFolder;
                ucActionBarBottom.DeleteButtonClick += ucActionBar.DoEditClassClick;
                ucActionBarBottom.DeleteButtonClick += ucActionBarBottom.DoEditClassClick;

                ucActionBar.NewButtonClick += ucResourceFolderAddEdit.DoNewResourceFolder;
                ucActionBar.NewButtonClick += ucResourceFolderList.DoHidden;
                ucActionBar.NewButtonClick += ucResourceFolderAddEdit.DoShow;
                ucActionBar.NewButtonClick += HiddenInfo;
                ucActionBarBottom.NewButtonClick += ucResourceFolderAddEdit.DoNewResourceFolder;
                ucActionBarBottom.NewButtonClick += ucResourceFolderList.DoHidden;
                ucActionBarBottom.NewButtonClick += ucResourceFolderAddEdit.DoShow;
                ucActionBarBottom.NewButtonClick += HiddenInfo;
                ucActionBarBottom.NewButtonClick += ucActionBar.DoEditClassClick;
                ucActionBar.NewButtonClick += ucActionBarBottom.DoEditClassClick;
                ucActionBarBottom.NewButtonClick += ucActionBarBottom.DoEditClassClick;
                ucActionBar.NewButtonClick += ucActionBar.DoEditClassClick;
                

                ucResourceFolderList.EventEditResourceFolder += ucResourceFolderAddEdit.DoEditResourceFolder;
                ucResourceFolderList.EventEditResourceFolder += ucResourceFolderAddEdit.DoShow;
                ucResourceFolderList.EventEditResourceFolder += ucResourceFolderList.DoHidden;
                ucResourceFolderList.EventEditResourceFolder += ucActionBar.DoListEditClick;
                ucResourceFolderList.EventEditResourceFolder += ucActionBarBottom.DoListEditClick; 
            }
            catch (Exception ex)
            {
                Logger.Error("[[ResourceFolder]]",ex);  
            }

        }
        public void HiddenInfo(object sender, EventArgs e)
        {
            pnlInfo.Visible = false;
        }
    }
}
